#include <iostream>
#include <functional>

void Print()
{
    std::cout << "函数指针!\n";
}

class test
{
public:
    void operator()()
    {
        std::cout << "仿函数!\n";
    }
};

int main()
{
#if 1
    std::function<void()> f = Print;
    f();
#endif

#if 0
    std::function<void()> f = []()
    { std::cout << "lambda!\n"; };
    f();
#endif

#if 0
    test t;
    std::function<void()> f = t;
    f();
#endif
    return 0;
}